<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

require_once ("includes/connect.php");
require_once ("includes/function.php");

$bank = $_REQUEST["bank"];
$branch_id = $_REQUEST["branch"];
$bank_type = $_REQUEST["bank_type"];
$a = $_REQUEST["a"];
$c = $_REQUEST["c"];

$i_date = $_REQUEST["i_date"];

if (is_array($a)) {
    $i = 0;
    foreach ($a as $value) {
        if (is_numeric($value)) {
            //echo $bank[$i];

            $sql = "INSERT INTO tbl_pay (payment, bank_id, bank_branch_id, bank_type, amount, cheque_no) "
                    . " VALUES ('เช็ค', '$bank[$i]', '$branch_id[$i]', '$bank_type[$i]', '$a[$i]',  '$c[$i]' ) ";

            echo $sql . "<br>";
//            mysql_query($sql) or die(mysql_error());
        }
        $i++;
    }


    //echo $sql . "<br>";
    //mysql_query($sql) or die(mysql_error());
}
?>

